Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite Inset Handling #283

Merged
merged 28 commits into from
Mar 2, 2025
Merged

Rewrite Inset Handling #283

merged 28 commits into from
Mar 2, 2025

Conversation

boswelja
Copy link
Collaborator

@boswelja boswelja commented Feb 22, 2025

Previously, we were relying on orientation values to handle some insets. This is NOT correct, and has even led to a few edge cases that weren't handled. I'm rewriting our inset handling to be orientation-agnostic.

Summary of changes:

  1. Removed landscapeCutoutPadding (very bad)
  2. Gutted any manual inset handling elsewhere
  3. Rewrote MediaSmallRow to take a contentPadding
  4. Rewrote screens to have one top-level WindowInsets (overridable), and apply it as needed

Tested changes:

UI components do not overlap any system bars in any orientation or device configuration (this includes Foldables, and other unique form factors)

@boswelja boswelja self-assigned this Feb 22, 2025
@imashnake0 imashnake0 self-assigned this Feb 26, 2025
@imashnake0 imashnake0 added the enhancement Enhancement label Feb 26, 2025
.padding(bottom = searchBarBottomPadding)
.navigationBarsPadding()
.consumeWindowInsets(PaddingValues(bottom = searchBarBottomPadding))
.imePadding()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't have to change this too much

@imashnake0 imashnake0 changed the title Rewrite inset handling Rewrite Inset Handling Mar 1, 2025
@imashnake0 imashnake0 marked this pull request as ready for review March 1, 2025 09:55
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

end = LocalPaddings.current.large
contentPadding = Paddings(
horizontal = LocalPaddings.current.large
) + Paddings(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cringe!

@imashnake0 imashnake0 merged commit 6cf4183 into main Mar 2, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants